package com.yubest.tool.bean;

import de.schlichtherle.license.AbstractKeyStoreParam;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @Author hweiyu
 * @Description
 * @Date 2022/6/15 17:58
 */
public class MyKeyStoreParam extends AbstractKeyStoreParam {

    private String priKeyPath;
    private String alias;
    private String storePwd;
    private String keyPwd;

    public MyKeyStoreParam(Class clazz, String resource, String alias, String storePwd, String keyPwd) {
        super(clazz, resource);
        this.priKeyPath = resource;
        this.alias = alias;
        this.storePwd = storePwd;
        this.keyPwd = keyPwd;
    }

    @Override
    public String getAlias() {
        return alias;
    }

    @Override
    public String getStorePwd() {
        return storePwd;
    }

    @Override
    public String getKeyPwd() {
        return keyPwd;
    }

    @Override
    public InputStream getStream() throws IOException {
        return new FileInputStream(new File(priKeyPath));
    }
}
